﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using log4net;


/// <summary>
/// Summary description for LogManager
/// </summary>

namespace ThapCam.Ulti
{
    public static class LogManager
    {    
        public static void createInstance()
        {
            log4net.Config.XmlConfigurator.Configure();           
        }

        public static void writeError(Type instance, string message= null, Exception exception = null)
        {
            ILog log = log4net.LogManager.GetLogger(instance);
            log.Error(exception);           
        }

        public static void writeDebug(Type instance, string value)
        {
            ILog log = log4net.LogManager.GetLogger(instance);
            log.Debug(value);
        }

        public static void writeWarning(Type instance, string message = null, Exception exception = null)
        {
            ILog log = log4net.LogManager.GetLogger(instance);
            log.Warn(message, exception);
        }
    }
}